1. Field of the Disclosure
This disclosure is related to an optical encoder capable of identifying absolute positions and an operating method thereof that identify the absolute positions according to the surface feature or the shutter parameter.
2. Description of the Related Art
Conventionally, means for optical encoding generally needs to process a working surface to have markers with a specific density for reflecting light or light penetration. Or the encoding is implemented by arranging light sources in a particular way or controlling the light emitting sequence. For example, U.S. Pat. No. 8,598,509 discloses a plurality of light sources for emitting light in a particular sequence as well as an encoded working surface with predetermined gaps such that the light can penetrate the gaps in a predetermined manner to be detected by a photodetector. The detection result is used to generate the coding reference data, e.g. position data or velocity data of some elements in the system.
However, in this conventional technology a special processing has to be performed on the working surface previously such that the application thereof is limited. Meanwhile, in order to obtain an accurate detection result, the processing of the working surface becomes complicated so that the difficulty of applying this technology also becomes higher.
SUMMARY
The present disclosure provides an optical encoder including a light sensing unit and a processing unit. The light sensing unit is configured to detect a marker at a reference position on a detection surface to capture an image, wherein the marker has patterned lines each formed between a first blackness region and a second blackness region of the marker. The processing unit is configured to generate a pulse width modulated (PWM) signal corresponding to the marker at the reference position on the detection surface, wherein the PWM signal has two signal levels each has a pulse width corresponding to a pixel distance between two detected lines in the captured image or between an edge of the captured image and one detected line in the captured image.
The present disclosure further provides a positioning system including a displacement generating unit, an optical navigation module and a back-end circuit. The displacement generating unit has a detection surface formed with a plurality of markers at different reference positions, and each of the markers has patterned lines each formed between a first blackness region and a second blackness region of the marker. The optical navigation module includes a light sensing unit and a processing unit. The light sensing unit is configured to detect the markers to capture an image. The processing unit is configured to output, in a comparison mode, a pulse width modulated (PWM) signal corresponding to the markers at the different reference positions on the detection surface, wherein the PWM signal has two signal levels each has a pulse width corresponding to a pixel distance between two detected lines in the captured image or between an edge of the captured image and one detected line in the captured image. The back-end circuit includes a memory and a microcontroller. The memory is configured to store predetermined PWM signals corresponding to the plurality of markers at the different reference positions. The microcontroller is configured to compare the outputted PWM signal with the predetermined PWM signal to determine a current position of the optical navigation module with respect to the detection surface.
The present disclosure further provides an operating method of an optical encoder. The optical encoder has a light sensing unit for capturing an image of a marker. The operating method includes the steps of: storing, in a registration mode, a predetermined pulse width modulated (PWM) signal corresponding to the marker at a reference position on a detection surface in a memory; and comparing, in a comparison mode, a current PWM signal with the predetermined PWM signal to determine a current position with respect to the detection surface, wherein the predetermined PWM signal and the current PWM signal have two signal levels each has a pulse width corresponding to a pixel distance between two detected lines, each of which is associated with a patterned line which is formed between a first blackness region and a second blackness region of the marker, in a captured image from the light sensing unit or between an edge of the captured image and one detected line in the captured image.
In one aspect, the processing unit is configured to identify the original position and the at least one reference position of the operation range according to a moving vector, a moving distance, a rotation angle or a rotation time.
In one aspect, the processing unit is configured to calculate a position difference between the comparison image data and the reference data to accordingly correct an accumulated error.
In one aspect, the processing unit is configured to identify positions at which a difference value between the comparison image data and the reference data exceeds an identification threshold as unidentified positions.
To achieve the above objects, at least one frame of image having features is recorded in the memory unit to be served as a reference basis in the following encoding process. Especially in the position correction function, an original position can be precisely set or a user may arbitrarily set the reference position according to the requirement. The image having features may be generated by forming markers on the detection surface for being detected by a sensing unit or by detecting surface features using the sensing unit.
The optical encoder of the present disclosure stores at least one frame of image having features or a processed image for indicating a specific position. Accordingly, when the optical encoder captures the image again, a position difference between the two images is reported by using the algorithm for being used by a system adopting the optical encoder. The system then fine tunes the position of the hardware so as to maintain a high accuracy.
When a detection surface has marks for being detected by a sensing unit, features of the markers, e.g. the size and the feature position, have to be arranged in cooperation with the size and the resolution of the sensing unit of the optical encoder as well as the disposed position of the optical encoder. Briefly speaking, the size of the sensing unit has to cover at least the frame formed by the light reflected from the features of the markers, and the resolution of the sensing unit has to be able to identify the features in the frame.
Compared to the conventional optical encoder, the optical navigation chip, the optical navigation module and the optical encoder provided by the present disclosure do not need any optical lens disposed on the light-emitting unit and the sensing array, and the optical navigation chip, the optical navigation module and the optical encoder can calculate the relative displacement between the optical navigation chip and the displacement generating unit of the optical encoder based on the images captured by the sensing array. Because the optical navigation chip, the optical navigation module and the optical encoder do not need the optical lens, the sizes of the optical navigation chip, the optical navigation module and the optical encoder can be reduced for microminiaturization.